package com.chenyue.cm.match.service.impl;


import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import com.chenyue.cm.base.service.BaseServiceImpl;
import com.chenyue.cm.base.dao.LcBaseMapper;
import org.springframework.beans.factory.annotation.Qualifier;
import com.chenyue.cm.match.dao.JdMatchTypeMapper;
import com.chenyue.cm.match.domain.JdMatchType;
import com.chenyue.cm.match.service.JdMatchTypeService;
import org.springframework.stereotype.Service;


/**
 * @author chenyue-cm
 */
@Service(value = "JdMatchTypeService")
public class JdMatchTypeServiceImpl extends BaseServiceImpl<JdMatchType> implements JdMatchTypeService {

    private final JdMatchTypeMapper jdMatchTypeMapper;

    public JdMatchTypeServiceImpl(@Qualifier("jdMatchTypeMapper") JdMatchTypeMapper jdMatchTypeMapper) {
        this.jdMatchTypeMapper = jdMatchTypeMapper;
    }

    @Override
    @Resource(name = "jdMatchTypeMapper")
    public void setBaseMapper(LcBaseMapper<JdMatchType, Serializable> baseMapper) {
        this.baseMapper = baseMapper;
    }

    @Override
    public List<JdMatchType> getMatchType() {
        List<JdMatchType> list = lambdaQuery().list();
        JdMatchType type = new JdMatchType();
        type.setId(0);
        type.setName("全部");
        list.add(0, type);
        return list;
    }
}
